function [ newSktp  sktpIndices ] = createSktp( oldSktp, pixelsInNewSktp )
%CreateSktp - Create a new skeleton point list by sampling an existing one
%   

    pixelsInOldSktp = size(oldSktp,1);
    sktpIndices = zeros(pixelsInNewSktp,1);
    newSktp = zeros(pixelsInNewSktp, 2);

    index = 0;
    step = floor(pixelsInOldSktp / (pixelsInNewSktp - 1));
    for i = 1:step:pixelsInOldSktp
      index = index + 1;
      sktpIndices(index) = i;
      newSktp(index,:) = oldSktp(i,:);
    end

    %Reet the last pixel in the list, since the loop may not terminate on the
    %exact last pixel
    newSktp(pixelsInNewSktp,:) = oldSktp(pixelsInOldSktp,:);
    sktpIndices(pixelsInNewSktp) = pixelsInOldSktp;  


end

%% This code was written by Ron Niehaus